var templageContnetJs = require('t_content/t_content.js');

var data = [{
  "magicId": 4,
  "title": "好像听撩人的话",
  "createTime": "2018-07-05 17:05:17",
  "colorScheme": {
    "themeId": 2,
    "themeName": "黄色系",
    "isDelete": 1,
    "bgColor": "-webkit-linear-gradient(top, rgb(234,185,45) 0%,rgb(199,152,16) 100%)",
    "navBgColor": "#E5B900",
    "navFontColor": "#ffffff",
    "qBgColor": "#ffffff",
    "qAuthorColor": "#ffffff",
    "qContentFontColor": "black",
    "aBgColor": "#ffffff",
    "aAuthorColor": "#ffffff",
    "aContentFontColor": "black",
    "buttonFontColor": "black",
    "buttonBgColor": "rgba(255, 255, 255, 0.5)"
  }
},
{
  "magicId": 3,
  "title": "ta会喜欢我吗",
  "createTime": "2018-06-30 11:23:04",
  "colorScheme": {
    "themeId": 2,
    "themeName": "黄色系",
    "isDelete": 1,
    "bgColor": "-webkit-linear-gradient(top, rgb(234,185,45) 0%,rgb(199,152,16) 100%)",
    "navBgColor": "#E5B900",
    "navFontColor": "#ffffff",
    "qBgColor": "#ffffff",
    "qAuthorColor": "#ffffff",
    "qContentFontColor": "black",
    "aBgColor": "#ffffff",
    "aAuthorColor": "#ffffff",
    "aContentFontColor": "black",
    "buttonFontColor": "black",
    "buttonBgColor": "rgba(255, 255, 255, 0.5)"
  }
}];

Page({

  //init data
  data:{
    magicList: data,
    animationMagicTopic:{},
    mag:'hello',
    magicContent:'',
    hehe:true
  },

  //onLoad
  onLoad:function(event){

  },

  //onShow
  onShow: function () {
    //animation
    var animationMagicTopic = wx.createAnimation({
      transformOrigin: "50% 50%",
      duration: 1000,
      timingFunction: "ease",
      delay: 0
    })

    this.animationMagicTopic = animationMagicTopic 

    this.setData({
      animationMagicTopic: animationMagicTopic.export()
    })

    //animation
    var animationMagicContent = wx.createAnimation({
      transformOrigin: "50% 50%",
      duration: 1000,
      timingFunction: "ease",
      delay: 0
    })

    this.animationMagicContent = animationMagicContent

    this.setData({
      animationMagicContent: animationMagicContent.export(),
    })
  },

  //lock Magic
  lockMagic:function(event){
    
    this.setData({
      hehe: false,
    })

    var systemInfo = wx.getSystemInfoSync();
    this.animationMagicTopic.translateY(-178 / 750 * systemInfo.windowWidth).step();

    this.setData({
      animationMagicTopic: this.animationMagicTopic.export(),
    })
    
    //旧的上去
   
    this.animationMagicContent.translateY(- 870 / 750 * systemInfo.windowWidth).step();
    this.setData({
      magicContent: '11111',
      animationMagicContent:this.animationMagicContent.export()
    })

  }

})